package zhou.teamwork14;

import java.sql.SQLException;

public class UserService {
		public boolean login(User user) throws SQLException{
			boolean result =false;
			UserDao ud=new UserDao();
			User u =ud.selectUserbyName(user.getUsername());
			if(u.getPwd().equals(user.getPwd())){
				result =true;
			}
			return result;
		}
		//测试方法；
		public static void main(String[] args) throws SQLException {
			UserService us=new UserService();
			User user=new User("huang","564");
			System.out.println(us.login(user));
		}
}
